import BattleUnit from "../BattleUnit";
import BattleUnitBase from "./BattleUnitBase";
import SkillBase from "./SkillBase";

/**
 * 战斗单位技能管理器
 */
export default class BattleUnitSkillMgr<T extends BattleUnitBase> {
    skills: SkillBase[] = [];
    /**冷却 */
    cools: Map<number, number> = new Map()
    /**根据权重获取一个可释放技能 */
    getRandomSkill(unit: T): SkillBase {
        this.skills.sort((a, b) => { return a.prority - b.prority });
        for (let skill of this.skills) {
            let cool = this.cools.get(skill.id);
            if (!cool) {
                return skill;
            }
        }
    }
}